package com.seventh.common.config;

import com.google.common.base.Predicates;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.service.VendorExtension;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import javax.xml.bind.annotation.XmlType;
import java.util.ArrayList;

/**
 * @program: clms-seventh
 * @description: 接口日志文件的配置类
 * @author: 张静
 * @create: 2021-07-16 14:38
 **/
@Configuration
@EnableSwagger2
public class SwaggerConfig {
    public Docket getDocket(){
        Docket docket=new Docket(DocumentationType.SWAGGER_2)
                .groupName("seventh")
                .apiInfo(apiInfo())
                .select()
                .paths(Predicates.not(PathSelectors.regex("/error.*")))
                .build();
        return docket;
    }
    private ApiInfo apiInfo(){
        Contact DEFAULT_CONTACT=new Contact("张静",
                "http://www.ll.com",
                "1765279081@qq.com");
        ApiInfo apiInfo=new ApiInfo("汽车租赁管理系统API接口文档", "员工管理系统API接口文档", "1.0", "http://www.bing.com",
                DEFAULT_CONTACT, "Apache 2.0",
                "http://www.apache.org/licenses/LICENSE-2.0", new
                ArrayList<VendorExtension>());

        return apiInfo;
    }
}
